home *** CD-ROM | disk | FTP | other *** search
- ******************************************************************
- * COPYRIGHT (C) 1986 by Donald Krantz and James Stanley
- * - Note: This is a real, live, actual, registered copyright,
- * and should be treated as such. This source code is from
- * the book "68000 Assembly Language", Krantz and Stanley,
- * Addison-Wesley Publishing Company, Reading, MA, 1986.
- *
- * Permission granted by the authors for non-commercial use
- * in programs released to the public domain, as long as this
- * copyright notice remains attached and visible.
- *
- ****************************************************************
- * CRT INTERFACE Routines - PRO68, CP/M68K, BIOS Rev 1.8,
- * hosted on Leading Edge PC / PRO-68
- * Count on all calls trashing D0.
- *
- * _CRT_CURSOR
- * This function sets the host cursor to an (X,Y) position.
- * Calling sequence: Push Y offset, then X offset, then call.
- * X and Y are binary numbers, offset zero, word length.
- *
- * _CRT_CLS
- * This function clears the host crt screen. No parameters.
- *
- * _CRT_PUT
- * This function dumps the next character typed directly to the
- * CRT. Calling sequence: Push the character as the low byte of
- * a word, then call.
- *
- * _CRT_GET
- * This function returns the next character typed at the console,
- * without echo. Character is in low byte of D0.W
- *
- * _KEYHIT
- * This function returns non-zero in D0.W if a character is
- * waiting for input from the console.
- *
- *****************************************************************
-
- xdef _crt_cls,_crt_cursor,_crt_put,_getkey,_keyhit
-
- _crt_cls:
- move.w d1,-(a7) * Save caller's D1
- move.w #$0006,d0 * CP/M Direct I/O call
- move.w #$001A,d1 * Clear Screen
- trap #2 * Call CP/M
- move.w (a7)+,d1 * Restore caller's D1
- rts
- *****************************************************************
- _crt_cursor:
- move.l d1,-(a7) * Save caller's D1
- move.w #$0006,d0 * CP/M Direct I/O call
- move.w #$001B,d1 * ESCape
- trap #2 * Call CP/M
- move.w #$0006,d0 * CP/M Direct I/O call
- move.w #$003D,d1 * Set Cursor
- trap #2 * Call CP/M
- move.w #$0006,d0 * CP/M Direct I/O call
- move.b 11(a7),d1 * Row Address
- ext.w d1 * sign extend
- add.w #$20,d1 * offset by 32
- trap #2 * Call CP/M
- move.w #$0006,d0 * CP/M Direct I/O call
- move.b 9(a7),d1 * Column Address
- ext.w d1 * sign extend
- add.w #$20,d1 * offset by 32
- trap #2 * Call CP/M
- move.l (a7)+,d1 * Restore caller's D1
- rts
- *****************************************************************
- _crt_put:
- move.l d1,-(a7) * Save caller's D1
- move.w #$0006,d0 * CP/M direct I/O call
- move.w 8(a7),d1 * character to output
- trap #2 * Call CP/M
- move.l (a7)+,d1 * Restore caller's D1
- rts
- *****************************************************************
- _getkey:
- move.w d1,-(a7) * Save caller's D1
- move.w #$0006,d0 * CP/M direct I/O call
- move.w #$00FF,d1 * Console input flag
- trap #2 * Call CP/M
- move.w (a7)+,d1 * Restore caller's D1
- rts
- *****************************************************************
- _keyhit:
- move.w d1,-(a7) * Save caller's D1
- move.w #$0006,d0 * CP/M direct I/O call
- move.w #$00FE,d1 * Console status flag
- trap #2 * Call CP/M
- move.w (a7)+,d1 * Restore caller's D1
- rts
-
- end